#!/usr/bin/python

import os
import sys


path = sys.argv[1]

f = open(path)

data = f.read()

f.close()

magic =  "\x7f\x45\x4c\x46\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

data = data.replace(magic,"\x7f\x45\x4c\x46" + "hello world\n")

print data.encode('hex')

f = open(path, "wb")

f.write(data)

f.close()
